﻿using System;
using System.Collections.Generic;
using System.Text;

using Xc.DataAccess.Core.Services;
using Xc.Logics.AepCoap.Services;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class ApplicationExtension
    {
        /// <summary>
        /// 添加转换器服务
        /// <list type="bullet">
        /// <item>转换器服务  <see cref="IConverterService"/></item>
        /// </list>
        /// </summary>
        /// <param name="serviceDescriptors"></param>
        /// <returns></returns>
        public static IServiceCollection AddConverterService(this IServiceCollection serviceDescriptors)
        {
            serviceDescriptors.AddTransient<IConverterService, ConverterService>();
            return serviceDescriptors;
        }
        /// <summary>
        /// 添加CSV服务
        ///  <list type="bullet">
        /// <item>CSV文件导出服务  <see cref="ICsvService"/></item>
        /// </list>
        /// </summary>
        /// <param name="serviceDescriptors"></param>
        /// <returns></returns>
        public static IServiceCollection AddCsvService(this IServiceCollection serviceDescriptors)
        {
            serviceDescriptors.AddTransient<ICsvService, CsvService>();
            return serviceDescriptors;
        }
        /// <summary>
        /// 获取编码器服务
        ///  <list type="bullet">
        /// <item>编码服务  <see cref="IEncodingService"/></item>
        /// </list>
        /// </summary>
        /// <param name="serviceDescriptors"></param>
        /// <returns></returns>
        public static IServiceCollection AddEncodingServcie(this IServiceCollection serviceDescriptors)
        {
            serviceDescriptors.AddTransient<IEncodingService, EncodingService>();
            return serviceDescriptors;
        }

    }
}
